翻訳と辞書
Words near each other
・ Deszkowice Drugie
・ Deszkowice Pierwsze
・ Deszkowice-Kolonia
・ Desznica
・ Deszno, Świętokrzyskie Voivodeship
・ Deszpot coat of arms
・ Destructive distillation
・ Destructive fishing practices
・ Destructive flour beetle
・ Destructive testing
・ Destructiveness (phrenology)
・ Destructo Doll
・ Destructo Trucks
・ Destructoid
・ Destructor
Destructor (computer programming)
・ Destrudo
・ Destry
・ Destry (band)
・ Destry (film)
・ Destry (TV series)
・ Destry Rides Again
・ Destry Rides Again (1932 film)
・ Destry Rides Again (album)
・ Destry Rides Again (disambiguation)
・ Destry Rides Again (musical)
・ Destry Rides Again (novel)
・ Destry Wright
・ Destry, Moselle
・ Destrées-class cruiser


Dictionary Lists
翻訳と辞書 辞書検索 [ 開発暫定版 ]
スポンサード リンク

Destructor (computer programming) : ウィキペディア英語版
Destructor (computer programming)
In object-oriented programming, a destructor (sometimes shortened to dtor) is a method which is automatically invoked when the object is destroyed. It can happen when its lifetime is bound to scope and the execution leaves the scope, when it is embedded into another object whose lifetime ends, or when it was allocated dynamically and is released explicitly. Its main purpose is to free the resources (memory allocations, open files or sockets, database connections, resource locks, etc.) which were acquired by the object along its life cycle and/or deregister from other entities which may keep references to it. The use of destructors is a necessity to the concept of Resource Acquisition Is Initialization (RAII).
In a language with an automatic garbage collection mechanism, it would be difficult to deterministically ensure the invocation of a destructor, and hence these languages are generally considered unsuitable for RAII. In such languages, unlinking an object from existing resources must be done by an explicit call of an appropriate function (usually called Dispose()). This method is also recommended for freeing resources rather than using finalizers for that.
==Destructor syntax==

* C++ has the naming convention in which destructors have the same name as the class of which they are associated with, but prefixed with a tilde (~).
* In Object Pascal, destructors have the keyword "destructor" and can have user-defined names (but are mostly called "Destroy").
* In Perl, the destructor method is named ''DESTROY''.
* In Python, the destructor method is named ''__del__''. 〔https://docs.python.org/2/reference/datamodel.html#object.__del__〕
* In Moose object system for Perl, the destructor method is named ''DEMOLISH''.
* In Objective-C, the destructor method is named "dealloc".
* In Swift, the destructor method is named deinit.
* In PHP 5, the destructor method is named "__destruct". There were no destructors in previous versions of PHP.〔(Constructors and Destructors ), from PHP online documentation〕

抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)
ウィキペディアで「Destructor (computer programming)」の詳細全文を読む



スポンサード リンク
翻訳と辞書 : 翻訳のためのインターネットリソース

Copyright(C) kotoba.ne.jp 1997-2016. All Rights Reserved.